<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Threads and mutexes</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_threading.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Threads and mutexes<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Oracle proposes a portable implementation of Mutex and Thread objects</p>
<p>OCILIB implements these OCI features for portable multi-threading support.</p>
<p>Mutexes are designed for mutual exclusion between thread in order to lock resources temporarily</p>
<p>Thread keys can be seen as process-wide variables that have a thread-specific values. It allows to create a unique key identified by a name (string) that can store values specific to each thread.</p>
<p>OCILIB exposes the types OCI_Mutex, OCI_Thread</p>
<dl class="section warning"><dt>Warning</dt><dd>OCILIB MUST be initialized with OCI_ENV_THREADED to enable threads support</dd>
<dd>
OCI_Thread relies on Oracle API which uses natives threading capabilities of the supported platform</dd>
<dd>
Using OCI_Mutex :<ul>
<li>On Microsoft Windows, a thread can call <a class="el" href="group___ocilib_c_api_threading.html#ga88a05b41e24b3bd1789688702cc6f4f4" title="Acquire a mutex lock. ">OCI_MutexAcquire()</a> more than once without any blocking. Just be sure that there is an <a class="el" href="group___ocilib_c_api_threading.html#ga366f287cf828533617faf0785181de7f" title="Release a mutex lock. ">OCI_MutexRelease()</a> for every <a class="el" href="group___ocilib_c_api_threading.html#ga88a05b41e24b3bd1789688702cc6f4f4" title="Acquire a mutex lock. ">OCI_MutexAcquire()</a> call</li>
<li>On Unix systems, a thread MUST call <a class="el" href="group___ocilib_c_api_threading.html#ga366f287cf828533617faf0785181de7f" title="Release a mutex lock. ">OCI_MutexRelease()</a> after every call to <a class="el" href="group___ocilib_c_api_threading.html#ga88a05b41e24b3bd1789688702cc6f4f4" title="Acquire a mutex lock. ">OCI_MutexAcquire()</a> in order to be able to call <a class="el" href="group___ocilib_c_api_threading.html#ga88a05b41e24b3bd1789688702cc6f4f4" title="Acquire a mutex lock. ">OCI_MutexAcquire()</a> again. If not, it will be blocked...</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define MAX_THREADS 50</span></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> key_cleanup(<span class="keywordtype">void</span> *str)</div>
<div class="line">{</div>
<div class="line">    free(str);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> worker(<a class="code" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *thread, <span class="keywordtype">void</span> *data)</div>
<div class="line">{</div>
<div class="line">   <span class="keyword">const</span> <span class="keywordtype">void</span> *<span class="keywordtype">id</span> = <a class="code" href="group___ocilib_c_api_raw_handles.html#ga94df890665f1f2ea39c3f4f4a00f9987">OCI_HandleGetThreadID</a>(thread);</div>
<div class="line">   <span class="keywordtype">char</span> *str = malloc(50);</div>
<div class="line"></div>
<div class="line">   sprintf(str, <span class="stringliteral">&quot;thread %p !\n&quot;</span>, <span class="keywordtype">id</span>);</div>
<div class="line"></div>
<div class="line">   <a class="code" href="group___ocilib_c_api_threading.html#ga627db7548da4a3d749f64253ae968d9c">OCI_ThreadKeySetValue</a>(<span class="stringliteral">&quot;ID&quot;</span>, str);</div>
<div class="line"></div>
<div class="line">   <span class="comment">/* ... do some more processing here... */</span></div>
<div class="line"></div>
<div class="line">   str = <a class="code" href="group___ocilib_c_api_threading.html#gad31beffff5fa23c1af211e4a7d33fee7">OCI_ThreadKeyGetValue</a>(<span class="stringliteral">&quot;ID&quot;</span>);</div>
<div class="line"></div>
<div class="line">   printf(str);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *th[MAX_THREADS];</div>
<div class="line">    <span class="keywordtype">int</span> i;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT | OCI_ENV_THREADED))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_threading.html#gaec7011dada56cbab7bba9eec43632d86">OCI_ThreadKeyCreate</a>(<span class="stringliteral">&quot;ID&quot;</span>, key_cleanup);</div>
<div class="line"></div>
<div class="line">     <span class="comment">/* create threads */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (i = 0; i &lt; MAX_THREADS; i++)</div>
<div class="line">    {</div>
<div class="line">        th[i] = <a class="code" href="group___ocilib_c_api_threading.html#ga1a2474e874215e0b42109ba042de5e3a">OCI_ThreadCreate</a>();</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_threading.html#ga1076c9942cc395f298ca350021031bfd">OCI_ThreadRun</a>(th[i], worker, NULL);</div>
<div class="line">    }</div>
<div class="line">  </div>
<div class="line">    <span class="comment">/* wait for threads and cleanup */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span> (i = 0; i &lt; MAX_THREADS; i++)</div>
<div class="line">    {</div>
<div class="line">       <a class="code" href="group___ocilib_c_api_threading.html#gadfec0263c6b8d508126a806c85898fb9">OCI_ThreadJoin</a>(th[i]);</div>
<div class="line">       <a class="code" href="group___ocilib_c_api_threading.html#gada7fa41aeedc7be2ce4f40c93ece524d">OCI_ThreadFree</a>(th[i]);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab0580aafc0e70358742e7c1e269895d5"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#gab0580aafc0e70358742e7c1e269895d5">OCI_MutexCreate</a> (void)</td></tr>
<tr class="memdesc:gab0580aafc0e70358742e7c1e269895d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a Mutex object.  <a href="#gab0580aafc0e70358742e7c1e269895d5">More...</a><br /></td></tr>
<tr class="separator:gab0580aafc0e70358742e7c1e269895d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga90c5cb68c0144b7bda9b75906c752ab5"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga90c5cb68c0144b7bda9b75906c752ab5">OCI_MutexFree</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *mutex)</td></tr>
<tr class="memdesc:ga90c5cb68c0144b7bda9b75906c752ab5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a mutex object.  <a href="#ga90c5cb68c0144b7bda9b75906c752ab5">More...</a><br /></td></tr>
<tr class="separator:ga90c5cb68c0144b7bda9b75906c752ab5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga88a05b41e24b3bd1789688702cc6f4f4"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga88a05b41e24b3bd1789688702cc6f4f4">OCI_MutexAcquire</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *mutex)</td></tr>
<tr class="memdesc:ga88a05b41e24b3bd1789688702cc6f4f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a mutex lock.  <a href="#ga88a05b41e24b3bd1789688702cc6f4f4">More...</a><br /></td></tr>
<tr class="separator:ga88a05b41e24b3bd1789688702cc6f4f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga366f287cf828533617faf0785181de7f"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga366f287cf828533617faf0785181de7f">OCI_MutexRelease</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *mutex)</td></tr>
<tr class="memdesc:ga366f287cf828533617faf0785181de7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a mutex lock.  <a href="#ga366f287cf828533617faf0785181de7f">More...</a><br /></td></tr>
<tr class="separator:ga366f287cf828533617faf0785181de7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a2474e874215e0b42109ba042de5e3a"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga1a2474e874215e0b42109ba042de5e3a">OCI_ThreadCreate</a> (void)</td></tr>
<tr class="memdesc:ga1a2474e874215e0b42109ba042de5e3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a Thread object.  <a href="#ga1a2474e874215e0b42109ba042de5e3a">More...</a><br /></td></tr>
<tr class="separator:ga1a2474e874215e0b42109ba042de5e3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gada7fa41aeedc7be2ce4f40c93ece524d"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#gada7fa41aeedc7be2ce4f40c93ece524d">OCI_ThreadFree</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *thread)</td></tr>
<tr class="memdesc:gada7fa41aeedc7be2ce4f40c93ece524d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a thread object.  <a href="#gada7fa41aeedc7be2ce4f40c93ece524d">More...</a><br /></td></tr>
<tr class="separator:gada7fa41aeedc7be2ce4f40c93ece524d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1076c9942cc395f298ca350021031bfd"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga1076c9942cc395f298ca350021031bfd">OCI_ThreadRun</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *thread, <a class="el" href="group___ocilib_c_api_datatypes.html#ga3594662df4f126aa9fc4bdec9ac6a199">POCI_THREAD</a> proc, void *arg)</td></tr>
<tr class="memdesc:ga1076c9942cc395f298ca350021031bfd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute the given routine within the given thread object.  <a href="#ga1076c9942cc395f298ca350021031bfd">More...</a><br /></td></tr>
<tr class="separator:ga1076c9942cc395f298ca350021031bfd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadfec0263c6b8d508126a806c85898fb9"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#gadfec0263c6b8d508126a806c85898fb9">OCI_ThreadJoin</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *thread)</td></tr>
<tr class="memdesc:gadfec0263c6b8d508126a806c85898fb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Join the given thread.  <a href="#gadfec0263c6b8d508126a806c85898fb9">More...</a><br /></td></tr>
<tr class="separator:gadfec0263c6b8d508126a806c85898fb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec7011dada56cbab7bba9eec43632d86"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#gaec7011dada56cbab7bba9eec43632d86">OCI_ThreadKeyCreate</a> (const otext *name, <a class="el" href="group___ocilib_c_api_datatypes.html#gad82d734ef2ba8d4e24874e3d6a6faa26">POCI_THREADKEYDEST</a> destfunc)</td></tr>
<tr class="memdesc:gaec7011dada56cbab7bba9eec43632d86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a thread key object.  <a href="#gaec7011dada56cbab7bba9eec43632d86">More...</a><br /></td></tr>
<tr class="separator:gaec7011dada56cbab7bba9eec43632d86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga627db7548da4a3d749f64253ae968d9c"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#ga627db7548da4a3d749f64253ae968d9c">OCI_ThreadKeySetValue</a> (const otext *name, void *value)</td></tr>
<tr class="memdesc:ga627db7548da4a3d749f64253ae968d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a thread key value.  <a href="#ga627db7548da4a3d749f64253ae968d9c">More...</a><br /></td></tr>
<tr class="separator:ga627db7548da4a3d749f64253ae968d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad31beffff5fa23c1af211e4a7d33fee7"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT void *OCI_API&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_threading.html#gad31beffff5fa23c1af211e4a7d33fee7">OCI_ThreadKeyGetValue</a> (const otext *name)</td></tr>
<tr class="memdesc:gad31beffff5fa23c1af211e4a7d33fee7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a thread key value.  <a href="#gad31beffff5fa23c1af211e4a7d33fee7">More...</a><br /></td></tr>
<tr class="separator:gad31beffff5fa23c1af211e4a7d33fee7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gab0580aafc0e70358742e7c1e269895d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a>* OCI_API OCI_MutexCreate </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Create a Mutex object. </p>
<dl class="section return"><dt>Returns</dt><dd>Mutex handle on success or NULL on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_mutex.html#ae99bda51943daf4d7c143dc4c8ec3072">ocilib::Mutex::Create()</a>.</p>

</div>
</div>
<a class="anchor" id="ga90c5cb68c0144b7bda9b75906c752ab5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_MutexFree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Destroy a mutex object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>- Mutex handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_mutex.html#a4bf7c7f3eba27a0ad21777fab817b00f">ocilib::Mutex::Destroy()</a>.</p>

</div>
</div>
<a class="anchor" id="ga88a05b41e24b3bd1789688702cc6f4f4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_MutexAcquire </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Acquire a mutex lock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>- Mutex handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_mutex.html#aefb570e2751c62913eea0abda981b31b">ocilib::Mutex::Acquire()</a>.</p>

</div>
</div>
<a class="anchor" id="ga366f287cf828533617faf0785181de7f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_MutexRelease </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#gadf74bea9761211fd1de22991a88282aa">OCI_Mutex</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Release a mutex lock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>- Mutex handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_mutex.html#aa88646ac37c9f5b74cb802fd3129a297">ocilib::Mutex::Release()</a>.</p>

</div>
</div>
<a class="anchor" id="ga1a2474e874215e0b42109ba042de5e3a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT <a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a>* OCI_API OCI_ThreadCreate </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Create a Thread object. </p>
<dl class="section return"><dt>Returns</dt><dd>Thread handle on success or NULL on failure </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread.html#aa8ea3f3d52603301bee5d1778cc871d7">ocilib::Thread::Create()</a>.</p>

</div>
</div>
<a class="anchor" id="gada7fa41aeedc7be2ce4f40c93ece524d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_ThreadFree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Destroy a thread object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>- Thread handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread.html#af672a19847e798b83fe3f5d7dd0ba16c">ocilib::Thread::Destroy()</a>.</p>

</div>
</div>
<a class="anchor" id="ga1076c9942cc395f298ca350021031bfd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_ThreadRun </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga3594662df4f126aa9fc4bdec9ac6a199">POCI_THREAD</a>&#160;</td>
          <td class="paramname"><em>proc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Execute the given routine within the given thread object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>- Thread handle </td></tr>
    <tr><td class="paramname">proc</td><td>- routine to execute </td></tr>
    <tr><td class="paramname">arg</td><td>- parameter to pass to the routine</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread.html#a3703d465704b99c4896b70510ca768c5">ocilib::Thread::Run()</a>.</p>

</div>
</div>
<a class="anchor" id="gadfec0263c6b8d508126a806c85898fb9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_ThreadJoin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga09c3bd0786917f352497f354351cd308">OCI_Thread</a> *&#160;</td>
          <td class="paramname"><em>thread</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Join the given thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread</td><td>- Thread handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function waits for the given thread to finish</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread.html#af55c3998611320a10f4c2f62c697de62">ocilib::Thread::Join()</a>.</p>

</div>
</div>
<a class="anchor" id="gaec7011dada56cbab7bba9eec43632d86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_ThreadKeyCreate </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#gad82d734ef2ba8d4e24874e3d6a6faa26">POCI_THREADKEYDEST</a>&#160;</td>
          <td class="paramname"><em>destfunc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Create a thread key object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>- Thread key name </td></tr>
    <tr><td class="paramname">destfunc</td><td>- Thread key value destructor function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Parameter proc is optional. It's called when the thread terminates to allow the program to deal with the thread specific value of the key</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread_key.html#ae075e1b66354c71e317c6a68c17985e3">ocilib::ThreadKey::Create()</a>.</p>

</div>
</div>
<a class="anchor" id="ga627db7548da4a3d749f64253ae968d9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_API OCI_ThreadKeySetValue </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Set a thread key value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>- Thread key name </td></tr>
    <tr><td class="paramname">value</td><td>- user value to set</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread_key.html#a7899df68a1e710315cc79500c418db6b">ocilib::ThreadKey::SetValue()</a>.</p>

</div>
</div>
<a class="anchor" id="gad31beffff5fa23c1af211e4a7d33fee7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT void* OCI_API OCI_ThreadKeyGetValue </td>
          <td>(</td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Get a thread key value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>- Thread key name</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Thread key value on success otherwise FALSE </dd></dl>

<p>Referenced by <a class="el" href="classocilib_1_1_thread_key.html#ad93fb8aef7bbafefe288abeaadec91c7">ocilib::ThreadKey::GetValue()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:37 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
